package com.zmc.admin.infrastructure.dao;

import com.zmc.admin.infrastructure.entity.SysRoleEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zmc.admin.infrastructure.entity.SysUserRoleEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 角色信息表
 * 
 * @author zmc
 * @email 
 * @date 2024-10-09 17:27:49
 */
@Mapper
public interface SysRoleDao extends BaseMapper<SysRoleEntity> {

    List<SysRoleEntity> selectRolePermissionByUserId(Long userId);

    List<SysRoleEntity> selectRolesByUserName(String userName);

    SysRoleEntity checkRoleNameUnique(String roleName);

    SysRoleEntity checkRoleKeyUnique(String roleKey);

    void deleteUserRoleInfo(SysUserRoleEntity userRole);


    void deleteUserRoleInfos(@Param("roleId") Long roleId, @Param("userIds") Long[] userIds);

    List<Long> selectRoleListByUserId(Long userId);

}
